import Vue from 'vue';
import Router from 'vue-router';
import PageTransition from '@/component/PageTransition/PageTransition';
import Home from '@/view/Home/Index/Home';
import SignIn from '@/view/User/SignIn/SignIn';
import SignUp from '@/view/User/SignUp/SignUp';
import Mine from '@/view/User/Mine/Mine';
import Message from '@/view/Message/Index/Message';
import RoomChat from '@/view/Message/RoomChat/RoomChat';
import PrivateChat from '@/view/Message/PrivateChat/PrivateChat';
import LiveBefore from '@/view/Live/Before/LiveBefore';
import Category from '@/view/Category/Index/Category';

Router.prototype.goBack = function() {
	this.isBack = true;
	window.history.go(-1);
};

Vue.use(Router);

export default new Router({
	routes: [{
		path: '/',
		name: 'PageTransition',
		component: PageTransition,
		children: [{
				path: '/',
				name: 'home',
				component: Home
			},
			{
				path: '/signIn',
				name: 'signIn',
				component: SignIn
			},
			{
				path: '/signUp',
				name: 'signUp',
				component: SignUp
			},
			{
				path: '/mine',
				name: 'mine',
				component: Mine
			},
			{
				path: '/message',
				name: 'message',
				component: Message
			},
			{
				path: '/roomChat',
				name: 'roomChat',
				component: RoomChat
			},
			{
				path: '/privateChat',
				name: 'privateChat',
				component: PrivateChat
			},
			{
				path: '/liveBefore',
				name: 'liveBefore',
				component: LiveBefore
			},
			{
				path: '/category',
				name: 'category',
				component: Category
			},
		]
	}]
})